pkg: copy Kijewski's container_of implementation

This PR fixes 141 of the compile time warnings caused by --pedantic by simply copying @Kijewskis 's implementation from `core/include/kernel_macros.h`

You should test if everything still works... ;-)