Jonathan Pereira scored the only goal as Villarreal beat Almeria to secure promotion back to the Primera Division.