Refactor attribute accessors

This PR aims for a complete refactoring step in the abstract
shell surface API code, aiming for a big removal of code there
in favour of some abstraction.

PR #625 prepares for the next few steps I want to do here,
to refactor the attribute writing into one API call here.

Blocked by #625.
Ame as above, for both, missing `NULL`-check and missing `free()`-call in case of `res != 0`.