I think one way to deal with this problem is to not let suspend/hibernate happen, if xflock4 fails (i.e. returns a nonzero exit code). An error message should be shown about it. (It should work similarly, when suspend/hibernate is triggered via Log Out dialog or Action Buttons.) That could be problematic, if user request suspend/hibernate when laptop lid is closed or when battery is low, though.
I think one way to deal with this problem is to not let suspend/hibernate happen, if xflock4 fails (i.e. returns a nonzero exit code). An error message should be shown about it. (It should work similarly, when suspend/hibernate is triggered via Log Out dialog or Action Buttons.) That could be problematic, if user request suspend/hibernate when laptop lid is closed or when battery is low, though.