Chaos and Locking in a Semiconductor Laser due to External Injection