safe function for require that returns undefined rather than throwing an error when a module is not found