fix($compile): returning null when an optional controller is not found

Currently, `undefined` is returned. However, the desired behavior is to
return `null` when the controller is optional and not found.

Closes #9404