I tried looking into this for two hours. Looks like there's again some undocumented magic going on for making the volume buttons accesible while the device is locked.
Better even would be a dbus server interface on the rockbox side and let headphoned handle this.