main: Fix open() retval of buffer driver
main: Fix missing dev_path and dev_dir_path assignments
main: Fix memleak in buffer driver