atomic: fix read() on i386, clean up types

Among other things, fixes #8969

Backport: firefly
Signed-off-by: Sage Weil <sage@redhat.com>