Polacken Robert Lewandowski frälste Barcelona när han på straff skickade in matchens enda mål hemma mot tabellsexan Rayo Vallecano.