Capture of ultracold neutrons in thin absorbing films