Fall back to `Exception` if `osexception` is not available

- For compatibility with < 2.8.0