Adaptive meshing strategies for nanophotonics using a posteriori error estimation