Stability analysis and the route to chaos for laser diodes with optical feedback