block: improve error handling in raw_open